<% layout('/layouts/default.html', {title: '任务部署信息表(主)管理', libs: ['validate','fileupload','dataGrid']}){ %>
<style>
.marginCenter{
	margin-left: 10%;
	margin-right: 10%;
}
</style>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text(dcSupTaskInfo.isNewRecord ? '任务明细' : '任务明细')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<div class="box-body">
			<#form:hidden path="id"/>
			<div class="row">
				<div class="form-unit">${text('基本信息')}</div>
				<!--基本任务信息-->
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('任务年度')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" name="taskYear">${dcSupTaskInfo.taskYear}年</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('任务类型')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" name="taskTypeName">${dcSupTaskInfo.taskTypeName}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('任务标题')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<label class="control-label" style="text-align: left;white-space: pre-line; word-wrap:break-word;">${dcSupTaskInfo.taskTitle}</label>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('任务内容')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<label class="control-label" style="text-align: left;white-space: pre-line;" >${dcSupTaskInfo.taskContent}</label>
							</div>
						</div>
					</div>

				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('督办要求')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<label class="control-label" style="text-align: left;white-space: pre-line;">${dcSupTaskInfo.taskRequireName!'无'}</label>
							</div>
						</div>
					</div>
					<% if(dcSupTaskInfo.normalFlag == '2'){ %>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('协同单位')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" style="text-align: left">${dcSupTaskInfo.taskCoopOrgName!'无'}</label>
							</div>
						</div>
					</div>
					<% } %>
				</div>
				<% if(dcSupTaskInfo.normalFlag == '2'){ %>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('督办人')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" style="text-align: left">${dcSupTaskInfo.taskSupUserName!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('督办科室')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" style="text-align: left">${dcSupTaskInfo.taskSupOrgName!'无'}</label>
							</div>
						</div>
					</div>
				</div>
				<% } %>
				<div class="row">

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('牵头领导')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" style="text-align: left">${dcSupTaskInfo.taskLeaderName!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('牵头责任单位')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<label class="control-label" style="text-align: left">${dcSupTaskInfo.taskLeaderOrgName!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6" hidden>
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('协同责任单位')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label">${dcSupTaskInfo.taskSupOrg}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">

				</div>

				<div class="row" >
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('联系人')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" style="text-align: left">${dcSupTaskInfo.contactName!'无'}</label>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('联系电话')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label">${dcSupTaskInfo.contactPhone!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('督办字号')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label">${dcSupTaskInfo.messageNumber!'无'}</label>
							</div>
						</div>
					</div>
					<% if(dcSupTaskInfo.auditorName != null){ %>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('审核人')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label">${dcSupTaskInfo.auditorName!'无'}</label>
							</div>
						</div>
					</div>
					<% } %>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('任务起始')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<%if(dcSupTaskInfo.taskStartTime!=null&&dcSupTaskInfo.taskStartTime!=''){%>
								<label class="control-label">${dcSupTaskInfo.taskStartTime,"yyyy-MM-dd HH:mm"}</label>
								<%}%>
								<%if(dcSupTaskInfo.taskStartTime==null||dcSupTaskInfo.taskStartTime==''){%>
								<label class="control-label">无</label>
								<%}%>

							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('任务截止')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<%if(dcSupTaskInfo.taskEndTime!=null&&dcSupTaskInfo.taskEndTime!=''){%>
								<label class="control-label">${dcSupTaskInfo.taskEndTime,"yyyy-MM-dd HH:mm"}</label>
								<%}%>
								<%if(dcSupTaskInfo.taskEndTime==null||dcSupTaskInfo.taskEndTime==''){%>
								<label class="control-label">无</label>
								<%}%>

							</div>
						</div>
					</div>
				</div>



			<div class="form-unit">${text('任务流程')}</div>
			<div class="ui-layout-center">
				<div class="main-content marginCenter">
					<div class="box box-main">
						<div class="ui-layout-content">
							<#form:form id="searchForm2" model="${empUser!}" action="${ctx}/backlog/dcSupBacklog/getDetailPage?taskId=${dcSupTaskInfo.id}" method="post" class="form-inline hide"
							data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}"
							data-order-by="${parameter.orderBy}">
						</#form:form>
						<table id="dataGrid2"></table>
						<div id="dataGrid2Page"></div>
					</div>
				</div>
			</div>


				<div class="form-unit">${text('反馈要求')}</div>
				<!--添加分解信息-->
				<div class="row" id="idOne">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('反馈起始')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<%if(dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackStartTime!=null&&dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackStartTime!=''){%>
								<label class="control-label">${dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackStartTime,"yyyy-MM-dd HH:mm"}</label>
								<%}%>
								<%if(dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackStartTime==null||dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackStartTime==''){%>
								<label class="control-label">无</label>
								<%}%>

							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('反馈截止')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<%if(dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackEndTime!=null&&dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackEndTime!=''){%>
								<label class="control-label">${dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackEndTime,"yyyy-MM-dd HH:mm"}</label>
								<%}%>
								<%if(dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackEndTime==null||dcSupTaskInfo.dcSupTaskInfoAddList[0].feedbackEndTime==''){%>
								<label class="control-label">无</label>
								<%}%>

							</div>
						</div>
					</div>
				</div>
				<div class="row multipleFeedback">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('反馈时间要求')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label">
								<div  >${dcSupTaskInfo.feedbackWay}	</div>
								</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<%if(dcSupTaskInfo.feedbackWay=='3'){%>
								<span class="required hide">*</span> ${text('每周')}：<i class="fa icon-question hide"></i></label>
							<%}%>
							<%if(dcSupTaskInfo.feedbackWay=='2'){%>
							<span class="required hide">*</span> ${text('每月')}：<i class="fa icon-question hide"></i></label>
							<%}%>
							<%if(dcSupTaskInfo.feedbackWay=='1'){%>
							<span class="required hide">*</span> ${text('每季度首月')}：<i class="fa icon-question hide"></i></label>
							<%}%>
							<div class="col-sm-3">

								<%if(dcSupTaskInfo.feedbackWay=='3'){%>
								<%if(dcSupTaskInfo.feedbackRate=='1'){%>
								<label class="control-label">${text('周一截止反馈')}</label>
								<%}%>
								<%if(dcSupTaskInfo.feedbackRate=='2'){%>
								<span class="control-label">${text('周二截止反馈')}</span>
								<%}%>
								<%if(dcSupTaskInfo.feedbackRate=='3'){%>
								<span class="control-label">${text('周三截止反馈')}</span>
								<%}%>
								<%if(dcSupTaskInfo.feedbackRate=='4'){%>
								<span class="control-label">${text('周四截止反馈')}</span>
								<%}%>
								<%if(dcSupTaskInfo.feedbackRate=='5'){%>
								<span class="control-label">${text('周五截止反馈')}</span>
								<%}%>
								<%}%>
								<%if(dcSupTaskInfo.feedbackWay=='2'||dcSupTaskInfo.feedbackWay=='2'){%>
								<label class="control-label">${dcSupTaskInfo.feedbackRate}</label>
								<span class="control-label">${text('号截止反馈')}</span>
								<%}%>
							</div>

						</div>
					</div>
				</div>
				<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('反馈附件必填')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<label class="control-label">${@DictUtils.getDictLabel('dc_feedback_file', dcSupTaskInfo.attachmentFlag+'', '无')}</label>
						</div>
					</div>
				</div>
				</div>
				<div class="row ">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">
								<span class="required hide">*</span> </label>
							<div class="col-sm-10">
								<table id="scheBusiTaskFeedbackDataGrid"></table>
							</div>
						</div>
					</div>
				</div>


				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">
								<span class="required hide">*</span> ${text('附件上传')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadFile" bizKey="${dcSupTaskInfo.id}" bizType="dcSupTaskInfo_file"
								uploadType="all" class="" readonly="true" preview="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="form-unit showInfo" id="lindao">${text('市领导批示')}</div>
				<%if(action!=''){%>
				<div class="form-unit showInfo1">${text('单位领导批示')}</div>
				<%}%>

			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<%if(dcSupTaskInfo.formFlag=='1'){%>
						<button class="btn btn-primary btn-sm" type="button" style="font-size: 14px"  id="batch">督 办 单 下 载</button>
						<%}%>
						<button type="button" class="btn btn-sm btn-primary" onclick=showInfoFeedbackDetail('${dcSupTaskInfo.id}')> ${text('查看反馈')}</button>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>

	</div>
</div>
<% } %>

<script>

	if('${dcSupTaskInfo.feedbackWay}'!='单次反馈'){
		$('#idOne').hide();
	}

	$('#userType').val('${dcSupTaskInfo.feedbackWay}').trigger('change');// 赋值方式2
	$('#feedbackWay').select2();
	var dd = $("#feedbackWay").find("option:selected").text()
	$("#feedbackWayName").text($("#feedbackWay").find("option:selected").text())

	var list = ${toJson(explainList)};
	var html="";
	$.each(list,function (dex,value) {
		// log(value)
		if(value){
			html=html+
					"\t\t\t\t<!--基本任务信息-->\n" +
					"\t\t\t\t<div class=\"row\">\n" +
					"\t\t\t\t\t<div class=\"col-xs-6\">\n" +
					"\t\t\t\t\t\t<div class=\"form-group\">\n" +
					"\t\t\t\t\t\t\t<label class=\"control-label col-sm-4\" title=\"\">\n" +
					"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 领导姓名：<i class=\"fa icon-question hide\"></i></label>\n" +
					"\t\t\t\t\t\t\t<div class=\"col-sm-8\">\n" +
					"\t\t\t\t\t\t\t\t<label class=\"control-label\">"+value.explainName+"</label>\n" +
					"\t\t\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t<div class=\"col-xs-6\">\n" +
					"\t\t\t\t\t\t<div class=\"form-group\">\n" +
					"\t\t\t\t\t\t\t<label class=\"control-label col-sm-4\" title=\"\">\n" +
					"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 批示时间：<i class=\"fa icon-question hide\"></i></label>\n" +
					"\t\t\t\t\t\t\t<div class=\"col-sm-8\">\n" +
					"\t\t\t\t\t\t\t\t<label class=\"control-label\">"+value.explainTime+"</label>\n" +
					"\t\t\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t</div>\n" +
					"\t\t\t\t</div>"+
					"\t\t\t\t<div class=\"row\">\n" +
					"\t\t\t\t\t<div class=\"col-xs-12\">\n" +
					"\t\t\t\t\t\t<div class=\"form-group\">\n" +
					"\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\" title=\"\">\n" +
					"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 批示内容：<i class=\"fa icon-question hide\"></i></label>\n" +
					"\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
					"\t\t\t\t\t\t\t\t<label class=\"control-label\"><span style=\"text-align:left;display: block;\">"+value.explainContent+"</span></label>\n" +
					"\t\t\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t</div>\n"
		}else{
			html='';
		}
	})
	$('.showInfo').after(html);

	$("#batch").click(function (){
		var data= $('#searchForm2');
		var id = ${toJson(dcSupTaskInfo.id)};
		js.ajaxSubmitForm(data,{
			url:"${ctx}/taskdeploy/dcSupTaskInfo/downLoadOverseeTheSingle?id="+id,
			downloadFile:true
		})
	})
	var action = ${toJson(action)};
	var html1 ='';
	if(action.explainFlag==2){
	html1 =
			"\t\t\t\t<!--基本任务信息-->\n" +
			"\t\t\t\t<div class=\"row\">\n" +
			"\t\t\t\t\t<div class=\"col-xs-6\">\n" +
			"\t\t\t\t\t\t<div class=\"form-group\">\n" +
			"\t\t\t\t\t\t\t<label class=\"control-label col-sm-4\" title=\"\">\n" +
			"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 领导姓名：<i class=\"fa icon-question hide\"></i></label>\n" +
			"\t\t\t\t\t\t\t<div class=\"col-sm-8\">\n" +
			"\t\t\t\t\t\t\t\t<label class=\"control-label\">"+action.explainName+"</label>\n" +
			"\t\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t<div class=\"col-xs-6\">\n" +
			"\t\t\t\t\t\t<div class=\"form-group\">\n" +
			"\t\t\t\t\t\t\t<label class=\"control-label col-sm-4\" title=\"\">\n" +
			"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 批示时间：<i class=\"fa icon-question hide\"></i></label>\n" +
			"\t\t\t\t\t\t\t<div class=\"col-sm-8\">\n" +
			"\t\t\t\t\t\t\t\t<label class=\"control-label\">"+action.explainTime+"</label>\n" +
			"\t\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n" +
			"\t\t\t\t</div>"+
			"\t\t\t\t<div class=\"row\">\n" +
			"\t\t\t\t\t<div class=\"col-xs-12\">\n" +
			"\t\t\t\t\t\t<div class=\"form-group\">\n" +
			"\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\" title=\"\">\n" +
			"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 批示内容：<i class=\"fa icon-question hide\"></i></label>\n" +
			"\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
			"\t\t\t\t\t\t\t\t<label class=\"control-label\"><span style=\"text-align:left;display: block;\">"+action.explainContent+"</span></label>\n" +
			"\t\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n"
	}
	$('.showInfo1').after(html1);

	// 统一加个按钮（查看反馈）
	// 单个牵头单位，就跳转到反馈列表；多个牵头单位，就跳转到牵头单位列表
	// 反馈人、收文员，只能看到本单位的；督查单位工作人员，可以看到所有的
	function showInfoFeedbackDetail(taskId) {
		js.addTabPage(null, "查看反馈", "${ctx}/action/dcSupTaskAction/showInfoFeedbackDetail?taskId=" + taskId, true);
	}



	// 初始化DataGrid对象
	$('#dataGrid2').dataGrid({
		searchForm: $("#searchForm2"),
		dataGridPage: $('#dataGrid2Page'),

		columnModel: [
			{header:'${text("任务表主键")}', name:'taskId', editable:true, hidden:true},
			{header:'${text("牵头责任单位")}', name:'leaderOrgName', editable:true, hidden:false},
			{header:'${text("当前流程")}', name:'backlogType3', editable:true, hidden:false},
			{header:'${text("办理人")}', name:'receiveUserCode', editable:true, hidden:false}
		],
		// 加载成功后执行事件
		ajaxSuccess: function(data){

		}
	});
</script>
